package com.i2863.shiroDemo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.i2863.shiroDemo.entity.Role;
import com.i2863.shiroDemo.mapper.RoleMapper;
import com.i2863.shiroDemo.service.IRoleService;
import org.springframework.stereotype.Service;

@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {

    @Override
    public Boolean saveRole(Role role) {
        if (role.getId() == null) {
            return this.save(role);
        } else {
            return this.updateById(role);
        }
    }
}